using System;
using Newtonsoft.Json;

namespace FBGraph.Models
{
    /// <summary>Specifies information about an event, including the location, event name, and which invitees plan to attend.</summary>
    /// <remarks>
    /// <para>Example: https://graph.facebook.com/331218348435 (Facebook Developer Garage Austin)</para>
    /// </remarks>
    public partial class Event : IFBGraphResult
    {
        /// <summary>The event ID</summary>
        [JsonPropertyAttribute("id")]
        public Int64 Id { get; set; }
        
        /// <summary>An object containing the name and ID of the user who owns the event</summary>
        [JsonPropertyAttribute("owner")]
        public Owner Owner { get; set; }
        
        /// <summary>The event title</summary>
        [JsonPropertyAttribute("name")]
        public String Name { get; set; }
        
        /// <summary>The long-form HTML description of the event</summary>
        [JsonPropertyAttribute("description")]
        public String Description { get; set; }
        
        /// <summary>The start time of the event, an ISO-8601 formatted date/time</summary>
        [JsonPropertyAttribute("start_time")]
        public DateTime StartTime { get; set; }
        
        /// <summary>The end time of the event, an ISO-8601 formatted date/time</summary>
        [JsonPropertyAttribute("end_time")]
        public DateTime EndTime { get; set; }
        
        /// <summary>The location for this event, a string name</summary>
        [JsonPropertyAttribute("location")]
        public String Location { get; set; }
        
        /// <summary>The visibility of this event.  Can be 'OPEN', 'CLOSED', or 'SECRET'</summary>
        [JsonPropertyAttribute("privacy")]
        public String Privacy { get; set; }
        
        /// <summary>The last time the event was updated</summary>
        [JsonPropertyAttribute("updated_time")]
        public DateTime UpdatedTime { get; set; }
        
        /// <summary>The location of this event, a structured address object with the properties street, city, state, zip, country, latitude, and longitude</summary>
        [JsonPropertyAttribute("venue")]
        public Venue Venue { get; set; }
        
        /// <summary>The RSVP status of a <see cref="User" /> or <see cref="Page" /> for the event</summary>
        [JsonPropertyAttribute("rsvp_status")]
        public String RsvpStatus { get; set; }
        
        /// <summary>Gets or sets a <see cref="Boolean" /> value representing whether the object has been populated.</summary>
        Boolean IFBGraphResult.IsReady { get; set; }
        /// <summary>Updates the current model with values from another like-typed model.</summary>
        /// <param name="other">The source model.</param>
        /// <remarks>This is used for asynchronous calls to update the reference that was returned when the original API method was called.</remarks>
        void IFBGraphResult.UpdateFrom(IFBGraphResult other)
        {
            var that = other as Event;
            if (that == null) return;
            else
            {
                this.Id = that.Id;
                this.Owner = that.Owner;
                this.Name = that.Name;
                this.Description = that.Description;
                this.StartTime = that.StartTime;
                this.EndTime = that.EndTime;
                this.Location = that.Location;
                this.Privacy = that.Privacy;
                this.UpdatedTime = that.UpdatedTime;
                this.Venue = that.Venue;
                this.RsvpStatus = that.RsvpStatus;
                ((IFBGraphResult)this).IsReady = true;
            }
            
        }
    }
}